<?php

class Manufacturer extends \Eloquent {
    protected $fillable = [];
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'Manufacturer';

    public static function getList() {
        $results = DB::table('Manufacturer')->get(array('id', 'manufacturer_name'));

        foreach ($results as $item) {
            $data[$item->id] = $item->manufacturer_name;
        }

        return isset($data) ? $data: array();
    }

    public static function getListMenu() {
        $result = self::query()
                ->where('status', '<>', 0)
                ->orderBy('updated_at', 'DESC');

        return $result->get();;
    }
}